<template>
	<view class="lntercept-canvas">
		<image class="image" src="https://rsyl.oss-cn-beijing.aliyuncs.com/e3dc41331f2d4f83ab2f7a57a0411146.png"
			mode="aspectFill">
		</image>
		<view class="button-box">
			<button class="button-left" @click="vipClick(0)"></button>
			<button class="button-right" @click="vipClick(1)"></button>
		</view>
	</view>
</template>
<script>
	import {
		BindCode
	} from "@/api/login.js"
	import storage from "@/utils/storage.js"
	export default {
		data() {
			return {};
		},
		onLoad(option) {
			// 推广
			if (option.scene) {
				storage.setTgCode(option.scene)
			}
		},
		methods: {
			vipClick(index) {
				const LoginState = storage.getHasLogin()
				if (LoginState) {
					BindCode()
					if (index === 0) {
						uni.redirectTo({
							url: '/pages/tabbar/user/vip/vip'
						})
					}
					if (index === 1) {
						uni.switchTab({
							url: '/pages/tabbar/home/index'
						})
					}
				} else {
					uni.navigateTo({
						url: `/pages/passport/wechatMPLogin?index=${index}`
					});
				}
			},
		}
	}
</script>

<style lang="scss">
	.lntercept-canvas {
		position: relative;

		.image {
			width: 100vw;
			height: 100vh;
			display: block
		}

		.button-box {
			position: absolute;
			bottom: 270upx;
			display: flex;
			justify-content: space-around;
			width: 750upx;

			.button-left {
				width: 324upx;
				height: 186upx;
				border-radius: 20upx;
				background-image: url('https://rsyl.oss-cn-beijing.aliyuncs.com/2d610cad4b22456d87d9201228e2fed1.png');
				background-size: 100% 100%;

			}

			.button-right {
				width: 324upx;
				height: 186upx;
				border-radius: 23upx;
				background-image: url('https://rsyl.oss-cn-beijing.aliyuncs.com/c7ffe34bc6bc406386ac8d3cda80e86e.png');
				background-size: 100% 100%;
			}
		}
	}
</style>
